package com.yoomiito.app.model.order;

import android.os.Parcel;
import android.os.Parcelable;

public class ShopCarGoods implements Parcelable {
    /**
     * product_id : 5131153095168901
     * product_img : https://mimitao-cdn.aijiamai.com/FhTZ-SxwBGdP8bzvrETbOn80iZaN
     * product_name : 桉树精油地板清洁剂
     * sale_price : 39.90
     * num : 1
     * is_deleted : 0
     */

    private String product_id;
    private String product_img;
    private String productName;
    private String salePrice;
    private int num;
    private int is_deleted;
    private boolean select;
    private String notes;

    public String banner;
    public String productPoint;

    /**
     * 仅用于创建订单时使用
     *
     * @param product_id
     * @param num
     * @param notes
     */
    public ShopCarGoods(String product_id, int num, String notes) {
        this.product_id = product_id;
        this.num = num;
        this.notes = notes;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

    public String getProduct_img() {
        return product_img;
    }

    public void setProduct_img(String product_img) {
        this.product_img = product_img;
    }

    public String getProduct_name() {
        return productName;
    }

    public void setProduct_name(String product_name) {
        this.productName = product_name;
    }

    public String getSale_price() {
        return salePrice;
    }

    public void setSale_price(String sale_price) {
        this.salePrice = sale_price;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public int getIs_deleted() {
        return is_deleted;
    }

    public void setIs_deleted(int is_deleted) {
        this.is_deleted = is_deleted;
    }

    public boolean isSelect() {
        return select;
    }

    public void setSelect(boolean select) {
        this.select = select;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.product_id);
        dest.writeString(this.product_img);
        dest.writeString(this.productName);
        dest.writeString(this.salePrice);
        dest.writeString(this.productPoint);
        dest.writeString(this.banner);
        dest.writeInt(this.num);
        dest.writeInt(this.is_deleted);
        dest.writeByte(this.select ? (byte) 1 : (byte) 0);
        dest.writeString(this.notes);
    }

    public ShopCarGoods() {
    }

    protected ShopCarGoods(Parcel in) {
        this.product_id = in.readString();
        this.product_img = in.readString();
        this.productName = in.readString();
        this.salePrice = in.readString();
        this.productPoint = in.readString();
        this.banner = in.readString();
        this.num = in.readInt();
        this.is_deleted = in.readInt();
        this.select = in.readByte() != 0;
        this.notes = in.readString();
    }

    public static final Creator<ShopCarGoods> CREATOR = new Creator<ShopCarGoods>() {
        @Override
        public ShopCarGoods createFromParcel(Parcel source) {
            return new ShopCarGoods(source);
        }

        @Override
        public ShopCarGoods[] newArray(int size) {
            return new ShopCarGoods[size];
        }
    };
}
